/*
 * Copyright 2016-2019 yoara
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package yhao.infra.web.common.tcc.aop;

import java.lang.annotation.*;

/**
 * Tcc请求标注接口
 * <p>tcc的事务是业务级而不是数据库级的，所以每个feign的调用实际上都已经提交了本地事务。
 * 我们说分布式事务tcc的机制，前提是操作/回滚的传递参数需要一致，这是业务端必须实现的。
 * 比如新增的form，是已经包含了id的，这样在执行回滚操作时，直接delete这个id。
 * 比如编辑的form，我们存在newValue和oldValue，或者返回的值里面包含了oldValue写回到form里，这样在撤销编辑时，我们用oldValue重写数据记录。
 *
 * @author yoara
 */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface TccCommand {

}
